The invention relates in general to computational fluid dynamics and in particular to the modeling of traveling shocks.
In fluid dynamics, traveling shock waves exist in situations such as, for example, blasts, vehicle-surface interaction with compressible flow, etc. Shock waves are very fine structures on the order of 0.5 mm thick. To properly model shock waves, one must use very fine grid, high-order solvers, and/or discontinuous function solvers. When modeling shock waves with continuous function solvers such as finite volume computational fluid dynamics solvers, it is necessary to use a fine grid and, if possible, higher order solvers. When the problem is unsteady, as is the case with traveling shock waves, the shock waves tend to defuse over time, if not properly modeled.
Because traveling shocks can travel through very large volumes of fluid, it is not practical to utilize fixed grids. A fixed grid size can result in more computations than a typical large high-performance computer can handle. For example, assume a grid resolution of 0.5 mm is fine enough to accurately predict the pressure across a traveling shock wave. Then, for a typical three-dimensional gun blast problem (i.e., about 225 cubic meters of air, or a slice of air the size of a quarter cylinder 2 meters high with a 12 meter radius), a fixed grid size of 0.5 mm requires about 3×1012 tetrahedral cells. Assuming about 200,000 cells per processor, about 15 million processors would be needed to solve this problem efficiently.
The number of cells (grid size) can be reduced dramatically using dynamic adaptation. However, if the dynamic adaptation scheme is poor, then the resulting number of cells can still be close to the number of cells of the fixed grid. To be practical, the number of cells should be several orders of magnitude smaller than the number of cells in the fixed grid described above. Adaptation is used to refine (decrease the cell size) or coarsen (increase the cell size) the grid structure at a particular location in the flow field. The grid may be coarsened after the shock wave passes through a particular location, thereby reducing the number of cells and computation time. A method is needed to mark the shock properly so that only the cells in the area of the shock wave are adapted and, the refining and coarsening of the grid are properly controlled throughout the simulation.
In the past, computational fluid dynamics (CFD) solvers have typically marked cells using gradients of pressure or some other flow field quantity. This method works to some extent with traveling shock problems. However, it is difficult to only adapt near the shock structure and not adapt at other locations in the flow field where other types of gradients exist. This difficulty results in significantly more grid adaptation than necessary and, consequently, additional computation needs.
Attempts to use known CFD packages with built-in adaptation functionality to solve traveling shock problems has resulted in excessive computation requirements. Some known methods include utilizing text user interface commands to perform complicated manipulation of adaptation registers; combining iso-levels of pressure and pressure gradients through adaptation register combines and then performing adaptation of the combined registers; and trying several types of variables, scaling or normalization levels, and adaptation control.
To minimize the number of cells in the adapted grid size, it is important that only the critical flow features be adapted, and that every thing else in the flow field be left “untouched”. Based on experience with the analysis of experimental and CFD blast analysis problems, the most critical flow features in a blast problem are the shock structures. It seems logical that pressure gradients would be a good indicator of shocks. To some extent this is true. However, pressure gradients exist in areas of the flow field other than areas near shocks. As a result, a large portion of the fluid volume can be adapted unnecessarily, leading to large amounts of unneeded computations. There is a need for an ability to detect only shocks and to refine the grid near the shock structures. In addition, there is a need to rapidly increase the cell size in areas that are not near the shock.
A problem that exists with gun blow-down, propagating shock or blast wave problems that does not exist in most compressible adaption scenarios is the extreme range of pressure gradient levels that exist within the flow domain. As a result, to adapt the weak shock structures, which are some of the most important structures in the flow field, one must use very low levels of refinement. Thus, the bulk of the flow field becomes over refined. It is possible to use zonal-based gradient adaption, however, zonal-based gradient adaptation does not address the fundamental need for a good shock detection capability.
There is a need for an improved shock detection and adaption marking method that can be utilized with finite volume computational fluid dynamics codes and provide large increases in performance. Such a method may utilize a computer and computational fluid dynamics computer software code.
It is an object of the invention to provide a method for detecting shock waves in a fluid dynamic model.
It is another object of the invention to provide a method for adapting a grid used to model a shock wave.
It is a further object of the invention to provide a grid adaptation method that reduces computation time, compared to known methods.
One aspect of the invention is a method of identifying a shock wave, comprising creating a grid comprising cells; sorting the cells based on their pressure gradients; and sorting the cells based on a negative dot product of their pressure gradients and their velocity vectors divided by a velocity of sound.
Sorting based on pressure gradients may include marking a cell for coarsening, if an absolute value of its pressure gradient is less than or equal to a preset pressure gradient value. Sorting based on pressure gradients may further include marking a cell for inclusion in the step of sorting based on the negative dot product, if an absolute value of its pressure gradient is greater than the preset pressure gradient value.
Sorting the cells based on the negative dot product may include marking a cell for refinement, if a negative dot product of its pressure gradient and its velocity vector divided by the velocity of sound is greater than a preset minimum dot product value and less than a preset maximum dot product value.
Sorting the cells based on the negative dot product may include marking a cell for coarsening, if a negative dot product of its pressure gradient and its velocity vector divided by the velocity of sound is one of: 1) less than or equal to the preset minimum dot product value, and 2) greater than or equal to the preset maximum dot product value.
The method may further comprise sorting the cells based on their distances from a shock wave center.
Sorting based on distances from a shock wave center may include marking a cell for coarsening, if its distance from the shock wave center is less than or equal to a threshold distance. The threshold distance may be determined from cells marked for refinement in a previous iteration. The threshold distance may be reduced to account for aspherical effects.
The method may further comprise sorting the cells based on their mass fractions of a species.
Sorting based on mass fractions of a species may include marking a cell for coarsening if its mass fraction of a secondary species is less than a threshold mass fraction of the secondary species. The threshold mass fraction of the secondary species may be a percentage of a mean mass fraction of the secondary species of cells marked for refinement in a previous iteration.
The method may further comprise creating a buffer zone adjacent shock front cells. Creating the buffer zone may include identifying contact cells, which are cells that contact at least one shock front cell. Creating the buffer zone may include identifying forward contact cells, which are contact cells that precede the shock wave.
A contact cell may be a forward contact cell, if a dot product of: 1) a vector from a centroid of a first shock front cell to a centroid of the contact cell, and 2) a velocity vector of the first shock front cell, is greater than zero.
The method may further comprise marking forward contact cells for refinement, the buffer zone comprising the forward contact cells.
The method may additionally comprise determining a number of time iterations required for the shock wave to pass through the buffer zone.
Another aspect of the invention is a computer readable medium containing a computer program for performing the method of the invention.
A further aspect of the invention is an apparatus for modeling a shock wave, comprising means for creating a grid comprising cells; means for sorting the cells based on their pressure gradients; and means for sorting the cells based a negative dot product of their pressure gradients and their velocity vectors divided by a velocity of sound.
The apparatus may further comprise one or more of means for sorting the cells based on their distances from a shock wave center; means for sorting the cells based on their mass fractions of a species; means for creating a buffer zone adjacent shock front cells; and means for determining a number of time iterations required for the shock wave to pass through the buffer zone.
The invention will be better understood, and further objects, features, and advantages thereof will become more apparent from the following description of the preferred embodiments, taken in conjunction with the accompanying drawings.